DTSTo2000 (DateString, Number)

Basic and Crystal syntax.

Arguments
Returns

a DateTime string with a four digit year

Action
Examples

Note:    Your computer date setting must be "yy/mm/dd" or "yyyy/mm/dd" in order for the following examples to return the correct results.

The following examples are applicable to Basic and Crystal syntax:

Here the window value is greater than the year and so it will change it to 20XX.

DTSTo2000(ToText(CDateTime(1988,12,12,12,12,12)), 90)

should return 2088/12/12 12:12:12PM

Here the window value is less than the year and so it will not change the year.

DTSTo2000(ToText(CDateTime(1984,12,12,1,2,3)), 83)

should return 1984/12/12 1:02:03AM

Other Examples

These are examples of a date that will not be affected by the function.

DTSTo2000(ToText(CDateTime(1899,12,12,1,2,3)), 99)

should return 1899/12/12 1:02:03AM

DTSTo2000(ToText(CDateTime(1899,12,12)), 99)

should return 1899/12/12 12:00:00PM

DTSTo2000(ToText(CDateTime(100,12,12,1,2,3)), 99)

should return 100/12/12 1:02:03AM

Some databases maintain the year of a date as a two digit field and so these samples will simulate that date field.

DTSTo2000(ToText(CDateTime(98,12,12,1,2,3)), 99)

should return 2098/12/12 1:02:03AM

DTSTo2000(ToText(CDateTime(98,12,12,1,2,3)), 97)

should return 1998/12/12 1:02:03AM

DTSTo2000(ToText(CDateTime(98,12,12)), 97)

should return 1998/12/12 12:00:00PM

DTSTo2000(ToText(CDateTime(9,12,12,1,2,3)), 10)

should return 2009/12/12 1:02:03AM

DTSTo2000(ToText(CDateTime(1,12,12,1,2,3)), 0)

should return 1901/12/12 1:02:03AM



Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com